home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
Sherlock 2.0
/
Sherlock_DevLib
/
sl2.h
< prev
Wrap
Text File
|
1996-04-06
|
4KB
|
148 lines
/*
Sherlock internal header.
Used for communication between the various Sherlock routines.
Do *not* include this file in your source files!
source: Lsl2.h
started: November 4, 1993.
version:
March 14, 1996.
Added SL_USE_MICROSECONDS constant
Added support for Metrowerks C.
February 5, 1996.
Added support for Symantec C.
Added prototype for sl_ticks for Symantec C and Think C.
September 25, 1995.
Added support for Code Warrior.
Protected the definitions of the TRUE and FALSE constants.
January 7, 1994.
*/
/*
Make sure this file is included only once.
*/
#ifndef SHERLOCK_H2_
#define SHERLOCK_H2_
#pragma once
/*
Set SL_ENV_MAC to 1 if we are running on a Macintosh.
*/
#if defined(THINK_C) || defined(SYMANTEC_C) || defined(applec) || defined(__MWERKS__)
#define SL_ENV_MAC 1
#else
#define SL_ENV_MAC 0
#endif
/*
Time related stuff:
Define SL_USE_MICROSECONDS is we will be using the
Apple Toolbox 'Microseconds'.
It is no longer possible to use the VIA timer code with Think C
because the Think C compiler could, in fact, be running on a PowerPc.
*/
#if defined(THINK_C) || defined(SYMANTEC_C) || defined(applec) || defined(__MWERKS__)
#define SL_USE_MICROSECONDS
#include <Timer.h>
#define sl_ticks() 0
#else
#undef SL_USE_MICROSECONDS
#if defined(TUPLE_C)
long _Ticks(void);
#define sl_ticks() _Ticks() /* Tuple VIA timer. */
#elif defined(applec)
#define sl_ticks() 0 /* Disable the timer logic. */
#else
#define sl_ticks() sl_count
#endif
#endif
/*
Define the stack used to keep track of nesting of Sherlock macros.
*/
typedef struct sl_stack_struct sl_snode;
struct sl_stack_struct {
sl_node * node; /* Pointer to statistic node. */
long overstart; /* Starting ticks for overhead. */
long start; /* Starting ticks. */
#ifdef SL_USE_MICROSECONDS
UnsignedWide wide_start;
#endif
long overhead; /* Inner overhead. */
};
/*
Define the sizes of the Sherlock tables.
*/
#define SL_MAX_STACK 100 /* Max stack level. */
#define SL_MAX_HASH 241 /* Size of hash table. */
#define SL_MAX_NODES 500 /* Max number of nodes. */
#define SL_MAX_OUT_LINE 200 /* Size of sl_buf_. */
/*
Define variable global to the various files.
These variables should *not* be used outside the Sherlock files.
*/
extern sl_snode * sl_stack; /* Sherlock stack. */
extern int sl_level; /* Stack pointer. */
extern int sl_lmax; /* Max stack pointer. */
extern sl_node ** sl_htab; /* Sherlock hash table. */
extern sl_node * sl_wcard; /* Head of wildcard list. */
extern char * sl_cname; /* Check name of current macro. */
extern bool sl_troff; /* TRUE: all tracing disabled. */
extern bool sl_nodots; /* TRUE: no level dots. */
extern bool sl_warning; /* TRUE: negative time warning. */
extern bool sl_full_trace; /* TRUE: make STATB the same as TICKB. */
extern long sl_neg_count; /* Count of negative times. */
extern int sl_node_count; /* Allocated nodes. */
/*
Define simple constants.
*/
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
/*
Define the number of beeps signaled by sl_abort.
*/
#define SL_ABORT_COUT 1
#define SL_ABORT_FIND 2
#define SL_ABORT_INIT 3
#define SL_ABORT_NEW 4
#define SL_ABORT_OVB 5
#define SL_ABORT_OVX 6
/*
Function prototypes for private routines.
None of these routines should be called from the user program.
*/
/* sl_init.c */
void sl_go (void);
sl_node * sl_new (char *s);
/* sl_util.c */
void sl_abort (int beeps);
void sl_check (char *s);
void sl_dots (int n);
void sl_exit (void);
sl_node * sl_find (char *, char *);
#endif /* SHERLOCK_H2_ */